package com.example.traning.mybatis;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author lei yu
 * @since 2025/04/21
 */
public interface EmpMapper {

    Emp getEmpByEmpno(Integer empno);

    Integer insertEmp(Emp emp);

//     Integer updateEmp(Emp emp);

    @Insert("""
            <script>
           insert emp(EMPNO, ENAME) values <foreach collection ='emps' item='emp' separator =','>  (#{emp.empno}, #{emp.ename}) </foreach >
           </script>""")
    Integer insertEmps(@Param("emps") List<Emp> emps);

}
